#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/resource.h>

int main(){
	struct rlimit r;
	if(getrlimit(RLIMIT_NOFILE,&r)<0)
	{
		fprintf(stderr,"getrlimit error\n");
		exit(1);
	}
	printf("RLIMIT_NOFILE cur:%d\n",r.rlim_cur);
	printf("RLIMIT_NOFILE max:%d\n",r.rlim_max);

	if(getrlimit(RLIMIT_NPROC,&r)<0)
	{
		fprintf(stderr,"getrlimit error\n");
		exit(1);
	}
	printf("RLIMIT_NOFILE cur:%d\n",r.rlim_cur);
	printf("RLIMIT_NOFILE max:%d\n",r.rlim_max);

	return 0;
}
